package com.lovely602.langchain4j.image.config;


import dev.langchain4j.community.model.dashscope.WanxImageModel;
import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.image.ImageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * @author lizhixing
 */
@Configuration
public class LLMConfig {


    @Bean("qwenImageChatModel")
    public ChatModel qwenImageChatModel() {
        return OpenAiChatModel.builder()
                .apiKey(System.getenv("AI_DASHSCOPE_API_KEY"))
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .modelName("qwen-vl-max-2025-08-13")
                .build();
    }

    /**
     * @Description: 测试通义万象来实现图片生成，收费功能
     * 知识出处，https://help.aliyun.com/zh/model-studio/text-to-image
     */
    @Bean("wanxImageModel")
    public WanxImageModel wanxImageModel() {
        return WanxImageModel.builder()
                .apiKey(System.getenv("AI_DASHSCOPE_API_KEY"))
                .modelName("flux-schnell") //图片生成 https://help.aliyun.com/zh/model-studio/text-to-image
                .build();
    }

}
